<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>04_深拷贝-lodash</title>
    </head>
    <body>
        <!-- <script src="./js/lodash.js"></script> -->

        <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.js"></script>

        <script>
            var obj1 = {
                a1:'zs',
                a2:18,
                a3:true,
                a4:undefined,
                a5:null,
                a6:[1,2,3],
                a7:function(){
                    console.log(111);
                },
                a8:{name:'ls'},
                a9:/\w{6,8}/
            }
            // 实际的企业级开发中 会在后端项目中使用到深拷贝   路由规则********
            var obj2 = _.cloneDeep(obj1);


            obj1.a6[1] = 666;
            console.log(obj1);
            console.log(obj2);

            console.log(obj1.a7 == obj2.a7);
        </script>
    </body>
</html>